package TestPaperSystem.controller;


import TestPaperSystem.Dto.ExamDTO;
import TestPaperSystem.Dto.PageUtils_VO;
import TestPaperSystem.service.ExamRepoService;
import TestPaperSystem.utils.R;
import TestPaperSystem.utils.ResponseUtils_R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xwj
 * @since 2023-03-25
 */
@RestController
@RequestMapping("/examRepo")
public class ExamRepoController {

    @Autowired
    ExamRepoService examRepoService;

    @PostMapping("/getById")
    public R getByExamId(@RequestBody PageUtils_VO page) throws Exception{
        return ResponseUtils_R.success(examRepoService.getByExamId(page.getId()));
    }

    @PostMapping("/save")
    public R saveData(@RequestBody ExamDTO examDTO) throws Exception{
        return ResponseUtils_R.success(examRepoService.saveData(examDTO));
    }
}

